package s14.ch16.ex3.homework;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class MyFilters {

	public static void main(String[] args) throws IOException {
		Integer space = 32;
		Integer krecha = 124;
		File outFile = new File("replace.ex3.homework.bin");
		outFile.createNewFile();
		InputStream in = new FileInputStream("input.bin");
		InputStream replace = new ReplaceInputFilter(in, space, krecha);
		OutputStream out = new FileOutputStream(outFile);
		Integer data = null;
		while ((data = replace.read()) != -1) {
			out.write(data);
		}
		in.close();
		out.close();
		System.out.println("done !!!!!");
	}

}
